<template>
  <div style="align: center; height: 100%; overflow: hidden">
    <div class="app-container" style="width: 100%;height: 100%">
      <el-row style="margin: 5px 0; height: 6%">
        <el-input v-model="url" :placeholder="$t('common.pleaseInputUrl')" style="width: 86%" />
        &nbsp;
        <el-button type="info" style="width: 10%" plain @click="openInNewPage">{{ $t('table.openInNewPage') }}</el-button>
      </el-row>
      <iframe :src="src" frameborder="no" style="width: 100%; height: 93%" scrolling="auto" />
    </div>
  </div>
</template>
<script>
export default {
  props: {
    src: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      url: this.src
    }
  },
  mounted: function() {
  },
  methods: {
    openInNewPage() {
      window.open(this.url, '_blank')
    }
  }
}
</script>
<style lang="scss" scoped>
  .app-container {
    margin: 0;
    padding: 5px;
  }
</style>
